<template>
  <div>
    <h6>
      <ul>
        <li v-for="item in arr" :key="item">{{ item }}</li>
      </ul>
      <button @click="fn">走一走</button>
    </h6>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["帅哥", "美女", "程序员"],
    };
  },
  methods: {
    fn() {
      // const key = this.arr[0];
      // const sum = this.arr.splice(0, 1);
      // const key = sum.splice(1, 0, sum);
      // const key = this.arr.shift();
      // console.log(key);
      const sum = this.arr.push(this.arr.shift());
      // console.log(sum);
    },
  },
};
</script>

<style>
h6 {
  padding-left: 30px;
  width: 300px;
  height: 150px;
  border: 1px solid red;
}
button {
  margin-top: 5px;
}
</style>